package design.donkey.auto.ddl.dialect.mysql.handler;

import design.donkey.auto.ddl.model.ColumnMetaModel;

/**
 * 无符号处理
 * 
 * @since 0.0.1
 * @author zhangjiakung
 */
public class ColumnHandlerForUnsigned implements ColumnHandler {
    @Override
    public String handle(ColumnMetaModel columnMetaModel) {
        return switch (columnMetaModel.getJdbcType()) {
            case TINYINT, SMALLINT, MEDIUMINT, INT, BIGINT, DECIMAL -> columnMetaModel.isUnsigned() ? "unsigned" : null;
            default -> null;
        };
    }

}
